<!-- 商品库商品列表页面 -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<link href="/css/jquery-select/jquery.searchableSelect.css" rel="stylesheet" type="text/css">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-left col-md-1 nopadding">
							<select id="type" data-placeholder="类型" id="type"
								class="form-control chosen-select" tabindex="2">
								<option value="" selected>状态</option>
								<option value="1">上架</option>
								<option value="0">下架</option>
								<option value="2">定时上架</option>
							</select>
						</div>
						<!-- <div class="columns pull-left col-md-1 nopadding">
							<select id="type" data-placeholder="属性" id="type"
								class="form-control chosen-select" tabindex="2">
								<option selected>属性</option>
								<option value="1">上架</option>
								<option value="0">下架</option>
							</select>
						</div> -->
						<input id="productType" name="productType"  value="5"  type="hidden">
						<div class="columns pull-left col-md-1 nopadding">
							<div class="class-close-content">
								<input type="text" id="pcate" class="form-control chosen-select" placeholder="顶级分类"
									   onclick="toCategoryOne()" readonly/>
								<a id="pcate-close" class="glyphicon glyphicon-remove close-icon" onclick="categoryCloseClick('one')"></a>
							</div>
							<input type="hidden" id="pcateId"/>
						</div>
						<div class="columns pull-left col-md-1 nopadding">
							<div class="class-close-content">
								<input type="text" id="ccate" class="form-control chosen-select" placeholder="下级分类"
									   onclick="toCategoryTwo()" readonly/>
								<a id="ccate-close" class="glyphicon glyphicon-remove close-icon" onclick="categoryCloseClick('two')"></a>
							</div>
							<input type="hidden" id="ccateId"/>
						</div>
						<div class="columns pull-left col-md-1 nopadding">
							<select  id="supply"
								class="form-control chosen-select" tabindex="2">
								<option value="" selected>供应商</option>
								<option th:each="item: ${supply}" th:text="${item.name}"
										th:value="${item.id}"></option>
							</select>
						</div>
						
						<div class="columns pull-left col-md-1 nopadding">
						<input type="text" class=" form-control"
							   id="upStartTime" name="upStartTime" placeholder="上架开始时间"
							   onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
							   style="background-color: #fff;" readonly="readonly"/>
					</div>
					<div class="columns pull-left">
						<label style="font-weight: 700;float: left;padding: 3px 10px;line-height: 2;font-size: 15px">
							<i class="fa fa-exchange"></i>
						</label>
					</div>
					<div class="columns pull-left col-md-1 nopadding">
						<input type="text" class=" form-control"
							   id="upEndTime" name="upEndTime" placeholder="上架结束时间"
							   onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
							   style="background-color: #fff;" readonly="readonly"/>
					</div>
						
						<div class="columns pull-left col-md-2 nopadding" th:if="${flag} == '0'">
							<select data-placeholder="商户" class="form-control chosen-select" id="centreId" name="centreId" tabindex="2">
								<option value="">选择商户</option>
								<option th:each="item: ${centreList}" th:text="${item.name}" th:value="${item.centreId}"></option>
							</select>
						</div>

						<div class="pull-left search nopadding">
							<input id="productName" name="productName" type="text"
								class="form-control" placeholder="输入需查询的关键字">
						</div>
						<div class="columns pull-left col-md-2 nopadding">
							<input id="excelFile" name="excelFile" type="file" 
								class="form-control" />
						</div>
						<div class="columns pull-left col-md-2 nopadding">
							<div class="col-md-6">
								<button class="btn btn-success" onclick="inport()">导入</button>
							</div>
							<div class="col-md-6" style="padding-left: 0px;">
								<a href="/files/平台商品库商品导入模板.xlsx"><u>导入模板</u></a>
							</div>
						</div>
						<div class="columns pull-right" role="group">
						<button class="btn btn-danger" shiro:hasPermission="product:manage:exportProduct"  onclick="exportProduct()">
								<i class="fa fa-mail-reply-all" aria-hidden="true"></i>导出
						</button>
							<button class="btn btn-success" onclick="reLoad()">
								<i class="fa fa-search" aria-hidden="true"></i>查询
							</button>
							<button class="btn btn-success" onclick="$('#modal-sales').modal('show')">
								<i class="fa fa-search" aria-hidden="true"></i>批量更新出售数量
							</button>
						</div>
					</div>
					<table id="productbaseTable" data-mobile-responsive="true"></table>
				</div>
			</div>
			<!-- <div class="panel panel-default">
				<div class="panel-body" style="padding: 0;">
					<table id="productbaseSaleListTable" data-mobile-responsive="true">
					</table>
					<table>
						<tr>
							<td height="50" colspan="7" align="right">平台总成本:  </td>
							<td align="center">
								<label  id="sumcostprice"> 0</label>
							</td>
							<td height="50" colspan="7" align="right">平台总利润:  </td>
							<td align="center">
								<label  id="sumlirun"> 0</label>
							</td>
						</tr>
					</table>
				</div>
			</div> -->

			<!-- 修改库存dialog start -->
				<div class="modal fade" id="modal-teams" tabindex="-1">
				<div class="modal-dialog">
					<div class="modal-content col-xs-7">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
									aria-hidden="true">×</button>
							<h4 class="modal-title">修改库存</h4>
						</div>
						<div class="modal-body">
							<div class="row">
								<div class="col-xs-7">
									<p id="productTitle"></p>
									<p><input type="hidden" id="productId" value=""/></p>
									<input id="total" name="total" placeholder="输入商品库存数量"
										   class="form-control" type="text" value="">
									<p></p>
								</div>
							</div>
							<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
								<div class="ui-dialog-buttonset">
									<button type="button" class="btn btn-primary" onclick="updateTotal()">
										确定
									</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			
			<div class="modal fade" id="modal-sales" tabindex="-1">
				<div class="modal-dialog">
					<div class="modal-content col-xs-7">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
									aria-hidden="true">×</button>
							<h4 class="modal-title">修改已出售数量</h4>
						</div>
						<div class="modal-body">
							<div class="row">
								<div class="col-xs-7">
									<input id="sales" name="sales" placeholder="输入数量" class="form-control" type="text" value="">
									<p></p>
								</div>
							</div>
							<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
								<div class="ui-dialog-buttonset">
									<button type="button" class="btn btn-primary" onclick="updateSales()">
										确定
									</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 修改库存dialog end -->

		<!--shiro控制bootstraptable行内按钮看见性 来自bootdo的创新方案 -->
		<div>
			<script type="text/javascript">
				var s_add_h = 'hidden';
				var s_edit_h = 'hidden';
				var s_remove_h = 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="product:manage:add">
			<script type="text/javascript">
				s_add_h = '';
			</script>
		</div>
		<div shiro:hasPermission="product:manage:edit">
			<script type="text/javascript">
				s_edit_h = '';
			</script>
		</div>
		<div shiro:hasPermission="product:manage:remove">
			<script type="text/javascript">
				var s_remove_h = '';
			</script>
		</div>
			<div shiro:hasPermission="product:manage:remove">
			<script type="text/javascript">
				var s_copy_h = '';
			</script>
		</div>
	</div>
	<div th:include="include::footer"></div>
	<script src="/js/appjs/product/managebase.js"></script>
	<script src="/js/jquery-select/jquery.searchableSelect.js"></script>
    <script type="text/javascript">
	$(function(){
		$('#supply').searchableSelect();
		$('#centreId').searchableSelect();
	});
	</script>
</body>

</html>